You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The development server contains a path traversal vulnerability on Windows when serving files from servedir.
Due to the use of path.Clean() (which only normalizes forward-slash / separators) instead of a Windows-aware path normalization function, it is possible to craft requests using backslashes (\) that bypass the intended directory containment logic. An attacker can escape the configured servedir root and access arbitrary files on the filesystem.
This issue affects Windows environments only.
path.Clean() will not normalize them, but the Windows filesystem will interpret \ as directory separators when resolving absPath.
Because the implementation does not verify that the final resolved path remains within servedir, it allows directory traversal outside the intended root directory.
Vulnerable Code
// https://github.com/evanw/esbuild/blob/v0.27.3/pkg/api/serve_other.go#L165queryPath:=path.Clean(req.URL.Path)[1:]
....
// Check for a file in the "servedir" directoryifh.servedir!=""&&kind!=fs.FileEntry {
absPath:=h.fs.Join(h.servedir, queryPath)
ifabsDir:=h.fs.Dir(absPath); absDir!=absPath {
ifentries, err, _:=h.fs.ReadDirectory(absDir); err==nil {
ifentry, _:=entries.Get(h.fs.Base(absPath)); entry!=nil&&entry.Kind(h.fs) == fs.FileEntry {
....
The esbuild Deno module (lib/deno/mod.ts) downloads native binary executables from an npm registry and writes them to disk with executable permissions (0o755) without performing any integrity verification (e.g., SHA-256 hash check). The Node.js equivalent (lib/npm/node-install.ts) includes a robust binaryIntegrityCheck() function that verifies SHA-256 hashes against hardcoded expected values from package.json, but this protection was never implemented for the Deno distribution.
When the NPM_CONFIG_REGISTRY environment variable is set, the Deno module constructs a download URL using this attacker-influenced value and fetches a native binary from it. Because no integrity check is performed, an attacker who can control this environment variable (common in CI/CD pipelines, shared development environments, or corporate networks with custom npm registries) can supply a malicious binary that will be downloaded, written to disk, and executed with the privileges of the Deno process, achieving full remote code execution.
asyncfunctioninstallFromNPM(name: string,subpath: string): Promise<string>{const{ finalPath, finalDir }=getCachePath(name)try{awaitDeno.stat(finalPath);returnfinalPath}catch(e){}constnpmRegistry=Deno.env.get("NPM_CONFIG_REGISTRY")||"https://registry.npmjs.org"// line 70: attacker-controlledconsturl=`${npmRegistry}/${name}/-/${name.replace("@​esbuild/","")}-${version}.tgz`// line 71: URL uses attacker baseconstbuffer=awaitfetch(url).then(r=>r.arrayBuffer())// line 72: downloadconstexecutable=extractFileFromTarGzip(newUint8Array(buffer),subpath)// line 73: extractawaitDeno.mkdir(finalDir,{recursive: true,mode: 0o700})awaitDeno.writeFile(finalPath,executable,{mode: 0o755})// line 80: write + chmodreturnfinalPath// line 81: no hash check}
Missing protection — The Node.js equivalent at lib/npm/node-install.ts lines 228–234:
functionbinaryIntegrityCheck(pkg: string,subpath: string,bytes: Uint8Array): void{consthash=crypto.createHash('sha256').update(bytes).digest('hex')constkey=`${pkg}/${subpath}`constexpected=packageJSON['esbuild.binaryHashes'][key]if(!expected)thrownewError(`Missing hash for "${key}"`)if(hash!==expected)thrownewError(...)}
This function is called in both the installUsingNPM() path (line 131) and the downloadDirectlyFromNPM() path (line 243), but no equivalent exists in the Deno module. Searching the entire git history confirms binaryIntegrityCheck, binaryHashes, sha256, and hash have never appeared in lib/deno/mod.ts.
Execution flow after download: The binary returned by installFromNPM() is passed to spawn() at line 291 of the same file:
Attack vector: The NPM_CONFIG_REGISTRY environment variable is a standard npm configuration variable widely used in enterprise CI/CD pipelines to point to internal artifact repositories (Artifactory, Nexus, Verdaccio, etc.). An attacker who can inject or modify this variable in a build environment (e.g., via CI config injection, shared environment, or compromised registry) can redirect the download to a server they control and serve a trojaned native binary.
Build-local verification — using the actual built deno/mod.js:
The esbuild Deno module was built from source (node scripts/esbuild.js ./esbuild --deno) producing deno/mod.js. The fake registry test was then re-run using the actual module via import * as esbuild from "file:///path/to/deno/mod.js", triggering the real installFromNPM() → installFromNPM() code path:
[TEST] esbuild Deno module loaded
[TEST] esbuild version: 0.28.0
[TEST] *** RCE VIA ACTUAL MODULE CONFIRMED ***
[TEST] Marker file content: VULN-CONFIRMED
[TEST] The actual built deno/mod.js downloaded and executed
[TEST] a malicious binary from the fake registry WITHOUT
[TEST] performing any SHA-256 integrity verification.
The malicious binary was cached at ~/.cache/esbuild/bin/@​esbuild-linux-x64@​0.28.0 with contents:
Built-in Deno module (deno/mod.js) confirmed to contain NPM_CONFIG_REGISTRY usage (line 1900) and zero references to binaryIntegrityCheck, binaryHashes, sha256, or crypto.createHash.
Negative/control case — Node.js rejects the same fake binary:
Fake binary SHA-256: d85234b9bac94fcda135d112f0c23d9c31bbb14a5502a37e743a3cf2a3750fa1
Expected hash: aafacdf135322bf47c882a4ea4db33d0375583f5b9c3fd2d4e12258e470568be
Hashes match: false
=> Node.js path REJECTS the fake binary (hash mismatch)
=> Deno path ACCEPTS it without any check
Impact
An attacker who can control the NPM_CONFIG_REGISTRY environment variable in a Deno project using esbuild can achieve arbitrary code execution with the privileges of the Deno process. This is particularly relevant in:
CI/CD pipelines where NPM_CONFIG_REGISTRY is commonly set to point to internal artifact repositories
Shared development environments where environment variables may be inherited from parent processes
Corporate networks where npm registry mirrors are configured via this environment variable
The attacker does not need to compromise the npm registry itself — only the environment variable or network path between the Deno process and the registry.
Suggested remediation
Add SHA-256 integrity verification to the Deno module, mirroring the existing binaryIntegrityCheck() function from lib/npm/node-install.ts:
// In lib/deno/mod.ts, after extracting the binary:consthashBuffer=awaitcrypto.subtle.digest("SHA-256",executable);consthash=Array.from(newUint8Array(hashBuffer)).map(b=>b.toString(16).padStart(2,'0')).join('');constkey=`${name}/${subpath}`;constexpected=EXPECTED_HASHES[key];// Import from a shared hash manifestif(hash!==expected)thrownewError(`Binary integrity check failed for "${key}"`);
Validate the NPM_CONFIG_REGISTRY URL to ensure it uses HTTPS (or at minimum warn about HTTP):
This release fixes a security issue where HTTP requests to esbuild's local development server could traverse outside of the serve directory on Windows using a \\ backslash character. It happened due to the use of Go's path.Clean() function, which only handles Unix-style / characters. HTTP requests with paths containing \\ are no longer allowed.
The previous release of esbuild added integrity checks to esbuild's npm install script. This release also adds integrity checks to esbuild's Deno install script. Now esbuild's Deno API will also fail with an error if the downloaded esbuild binary contains something other than the expected content.
Note that esbuild's Deno API installs from registry.npmjs.org by default, but allows the NPM_CONFIG_REGISTRY environment variable to override this with a custom package registry. This change means that the esbuild executable served by NPM_CONFIG_REGISTRY must now match the expected content.
Avoid inlining using and await using declarations (#4482)
Previously esbuild's minifier sometimes incorrectly inlined using and await using declarations into subsequent uses of that declaration, which then fails to dispose of the resource correctly. This bug happened because inlining was done for let and const declarations by avoiding doing it for var declarations, which no longer worked when more declaration types were added. Here's an example:
// Original code{usingx=newResource()x.activate()}// Old output (with --minify)newResource().activate();// New output (with --minify){usinge=newResource;e.activate()}
Fix module evaluation when an error is thrown (#4461, #4467)
If an error is thrown during module evaluation, esbuild previously didn't preserve the state of the module for subsequent module references. This was observable if import() or require() is used to import a module multiple times. The thrown error is supposed to be thrown by every call to import() or require(), not just the first. With this release, esbuild will now throw the same error every time you call import() or require() on a module that throws during its evaluation.
Fix some edge cases around the new operator (#4477)
Previously esbuild incorrectly printed certain edge cases involving complex expressions inside the target of a new expression (specifically an optional chain and/or a tagged template literal). The generated code for the new target was not correctly wrapped with parentheses, and either contained a syntax error or had different semantics. These edge cases have been fixed so that they now correctly wrap the new target in parentheses. Here is an example of some affected code:
// Original codenew(foo()`bar`)()new(foo()?.bar)()// Old outputnewfoo()`bar`();new(foo())?.bar();// New outputnew(foo())`bar`();new(foo()?.bar)();
This release fixes a bug where var declarations in nested scopes that are hoisted up to module scope were not correctly being renamed during bundling. That could previously lead to name collisions when minification was disabled, which could potentially cause a behavior change. The bug has been fixed so that these hoisted declarations are now considered to be module-level symbols during the name collision avoidance pass.
Emit var instead of const for certain TypeScript-only constructs for ES5 (#4448)
While esbuild doesn't generally support converting const to var for ES5 due to nested scoping rules (which is currently a build-time error), esbuild previously incorrectly converted TypeScript-only import assignment constructs into a const declaration even when targeting ES5. With this release, esbuild will now use var for this case instead:
// Original codeimportx=require('y')// Old output (with --target=es5)constx=require("y");// New output (with --target=es5)varx=require("y");
Configuration
📅 Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦 Automerge: Enabled.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: pnpm-lock.yaml
Scope: all 9 workspace projects
Progress: resolved 1, reused 0, downloaded 0, added 0
Progress: resolved 39, reused 0, downloaded 0, added 0
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /runner/cache/others/pnpm/store/v10
Virtual store is at: node_modules/.pnpm
WARN The git-hosted package fetched from "https://codeload.github.com/mariohamann/tailwindcss-var/tar.gz/671cedc8890c64d3a54173513f5cb9d6dea4aaf1" has to be built but the build scripts were ignored.
Progress: resolved 51, reused 0, downloaded 1, added 0
Progress: resolved 61, reused 0, downloaded 1, added 0
Progress: resolved 71, reused 0, downloaded 1, added 0
Progress: resolved 83, reused 0, downloaded 1, added 0
Progress: resolved 106, reused 0, downloaded 1, added 0
Progress: resolved 110, reused 0, downloaded 1, added 0
Progress: resolved 112, reused 0, downloaded 1, added 0
Progress: resolved 114, reused 0, downloaded 1, added 0
Progress: resolved 115, reused 0, downloaded 1, added 0
/tmp/renovate/repos/github/solid-design-system/solid/packages/components:
ERR_PNPM_NO_MATURE_MATCHING_VERSION Version 0.28.1 (released 24 hours ago) of @esbuild/android-arm64 does not meet the minimumReleaseAge constraint
This error happened while installing the dependencies of esbuild@0.28.1
The latest release of @esbuild/android-arm64 is "0.28.1". Published at 6/11/2026
Other releases are:
* false: 0.0.1-ignorepls published at 11/2/2025
If you need the full list of all 113 published versions run "$ pnpm view @esbuild/android-arm64 versions".
If you want to install the matched version ignoring the time it was published, you can add the package name to the minimumReleaseAgeExclude setting. Read more about it: https://pnpm.io/settings#minimumreleaseageexclude
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.28.0→0.28.1esbuild allows arbitrary file read when running the development server on Windows
GHSA-g7r4-m6w7-qqqr
More information
Details
Summary
The development server contains a path traversal vulnerability on Windows when serving files from
servedir.Due to the use of
path.Clean()(which only normalizes forward-slash/separators) instead of a Windows-aware path normalization function, it is possible to craft requests using backslashes (\) that bypass the intended directory containment logic. An attacker can escape the configuredservedirroot and access arbitrary files on the filesystem.This issue affects Windows environments only.
Details
The request path is sanitized using:
However:
path.Clean()is POSIX-style and only understands/(docs:https://pkg.go.dev/path#Clean)\is a valid path separatorpath.Clean()does not treat\as a separatorLater, the server constructs the absolute path:
If
queryPathcontains sequences such as:path.Clean()will not normalize them, but the Windows filesystem will interpret\as directory separators when resolvingabsPath.Because the implementation does not verify that the final resolved path remains within
servedir, it allows directory traversal outside the intended root directory.Vulnerable Code
Steps to reproduce
Impact
Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
esbuild: Missing binary integrity verification in Deno module enables remote code execution via NPM_CONFIG_REGISTRY
GHSA-gv7w-rqvm-qjhr
More information
Details
Summary
The esbuild Deno module (
lib/deno/mod.ts) downloads native binary executables from an npm registry and writes them to disk with executable permissions (0o755) without performing any integrity verification (e.g., SHA-256 hash check). The Node.js equivalent (lib/npm/node-install.ts) includes a robustbinaryIntegrityCheck()function that verifies SHA-256 hashes against hardcoded expected values frompackage.json, but this protection was never implemented for the Deno distribution.When the
NPM_CONFIG_REGISTRYenvironment variable is set, the Deno module constructs a download URL using this attacker-influenced value and fetches a native binary from it. Because no integrity check is performed, an attacker who can control this environment variable (common in CI/CD pipelines, shared development environments, or corporate networks with custom npm registries) can supply a malicious binary that will be downloaded, written to disk, and executed with the privileges of the Deno process, achieving full remote code execution.Details
Vulnerable code path —
lib/deno/mod.tslines 62–82:Missing protection — The Node.js equivalent at
lib/npm/node-install.tslines 228–234:This function is called in both the
installUsingNPM()path (line 131) and thedownloadDirectlyFromNPM()path (line 243), but no equivalent exists in the Deno module. Searching the entire git history confirmsbinaryIntegrityCheck,binaryHashes,sha256, andhashhave never appeared inlib/deno/mod.ts.Execution flow after download: The binary returned by
installFromNPM()is passed tospawn()at line 291 of the same file:Attack vector: The
NPM_CONFIG_REGISTRYenvironment variable is a standard npm configuration variable widely used in enterprise CI/CD pipelines to point to internal artifact repositories (Artifactory, Nexus, Verdaccio, etc.). An attacker who can inject or modify this variable in a build environment (e.g., via CI config injection, shared environment, or compromised registry) can redirect the download to a server they control and serve a trojaned native binary.PoC
Prerequisites: Deno runtime, Node.js (for fake registry)
Step 1: Create a fake npm registry that serves a malicious binary:
Step 2: Run the PoC with
NPM_CONFIG_REGISTRYpointing to the fake server:Step 3: Run:
Observed output in this environment:
Build-local verification — using the actual built
deno/mod.js:The esbuild Deno module was built from source (
node scripts/esbuild.js ./esbuild --deno) producingdeno/mod.js. The fake registry test was then re-run using the actual module viaimport * as esbuild from "file:///path/to/deno/mod.js", triggering the realinstallFromNPM()→installFromNPM()code path:The malicious binary was cached at
~/.cache/esbuild/bin/@​esbuild-linux-x64@​0.28.0with contents:Built-in Deno module (
deno/mod.js) confirmed to containNPM_CONFIG_REGISTRYusage (line 1900) and zero references tobinaryIntegrityCheck,binaryHashes,sha256, orcrypto.createHash.Negative/control case — Node.js rejects the same fake binary:
Impact
An attacker who can control the
NPM_CONFIG_REGISTRYenvironment variable in a Deno project using esbuild can achieve arbitrary code execution with the privileges of the Deno process. This is particularly relevant in:NPM_CONFIG_REGISTRYis commonly set to point to internal artifact repositoriesThe attacker does not need to compromise the npm registry itself — only the environment variable or network path between the Deno process and the registry.
Suggested remediation
binaryIntegrityCheck()function fromlib/npm/node-install.ts:NPM_CONFIG_REGISTRYURL to ensure it uses HTTPS (or at minimum warn about HTTP):ESBUILD_BINARY_PATHvalidation in the Deno module, mirroring theisValidBinaryPath()check fromlib/npm/node-platform.ts.Regression test suggestion: Add a test that verifies the Deno download path rejects a binary with a mismatched SHA-256 hash.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
evanw/esbuild (esbuild)
v0.28.1Compare Source
Disallow
\\in local development server HTTP requests (GHSA-g7r4-m6w7-qqqr)This release fixes a security issue where HTTP requests to esbuild's local development server could traverse outside of the serve directory on Windows using a
\\backslash character. It happened due to the use of Go'spath.Clean()function, which only handles Unix-style/characters. HTTP requests with paths containing\\are no longer allowed.Thanks to @dellalibera for reporting this issue.
Add integrity checks to the Deno API (GHSA-gv7w-rqvm-qjhr)
The previous release of esbuild added integrity checks to esbuild's npm install script. This release also adds integrity checks to esbuild's Deno install script. Now esbuild's Deno API will also fail with an error if the downloaded esbuild binary contains something other than the expected content.
Note that esbuild's Deno API installs from
registry.npmjs.orgby default, but allows theNPM_CONFIG_REGISTRYenvironment variable to override this with a custom package registry. This change means that the esbuild executable served byNPM_CONFIG_REGISTRYmust now match the expected content.Thanks to @sondt99 for reporting this issue.
Avoid inlining
usingandawait usingdeclarations (#4482)Previously esbuild's minifier sometimes incorrectly inlined
usingandawait usingdeclarations into subsequent uses of that declaration, which then fails to dispose of the resource correctly. This bug happened because inlining was done forletandconstdeclarations by avoiding doing it forvardeclarations, which no longer worked when more declaration types were added. Here's an example:Fix module evaluation when an error is thrown (#4461, #4467)
If an error is thrown during module evaluation, esbuild previously didn't preserve the state of the module for subsequent module references. This was observable if
import()orrequire()is used to import a module multiple times. The thrown error is supposed to be thrown by every call toimport()orrequire(), not just the first. With this release, esbuild will now throw the same error every time you callimport()orrequire()on a module that throws during its evaluation.Fix some edge cases around the
newoperator (#4477)Previously esbuild incorrectly printed certain edge cases involving complex expressions inside the target of a
newexpression (specifically an optional chain and/or a tagged template literal). The generated code for thenewtarget was not correctly wrapped with parentheses, and either contained a syntax error or had different semantics. These edge cases have been fixed so that they now correctly wrap thenewtarget in parentheses. Here is an example of some affected code:Fix renaming of nested
vardeclarations (#4471)This release fixes a bug where
vardeclarations in nested scopes that are hoisted up to module scope were not correctly being renamed during bundling. That could previously lead to name collisions when minification was disabled, which could potentially cause a behavior change. The bug has been fixed so that these hoisted declarations are now considered to be module-level symbols during the name collision avoidance pass.Emit
varinstead ofconstfor certain TypeScript-only constructs for ES5 (#4448)While esbuild doesn't generally support converting
consttovarfor ES5 due to nested scoping rules (which is currently a build-time error), esbuild previously incorrectly converted TypeScript-onlyimportassignment constructs into aconstdeclaration even when targeting ES5. With this release, esbuild will now usevarfor this case instead:Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.